package com.dhgate.spu.analysis.index;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.dhgate.spu.analysis.consts.SpuStandardConsts;
import com.dhgate.spu.analysis.dao.DAOFactory;
import com.dhgate.spu.analysis.init.InitDbConfig;
import com.dhgate.spu.analysis.init.InitParameter;

/** 
 * @author:      wangguodong 
 * @create:      2014-2-13 下午3:34:50 
 * @description: 
 */
public class IndexMain {
	private static final Logger logger = LoggerFactory.getLogger(IndexMain.class);
	public static void main(String[] args) throws Exception {
		if(args.length<1){
			throw new Exception("input prodlineid is null");
		}
		
		logger.info("IndexMain begin");
		long startTime = System.currentTimeMillis();
		//初始化基本配置参数
		InitParameter.init();
		
		//初始化数据来源
		DAOFactory.init();
		
		//读取数据库初始化配置
		InitDbConfig.init();
		
		SpuStandardConsts.init();
		
		
		//查询产品数据提取产品型号创建doc批量增加索引
		IndexProduct.process(args[0]);
		
		logger.info("IndexMain end, all cost time:"+(System.currentTimeMillis() - startTime)/1000+"s");
	}
	

}
